//
//  YBTextFild.h
//  shortvideoplay
//
//  Created by tikeios_002 on 2024/6/12.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    YBAFormatterTextFieldTypeNumber = 10, // 数字
    YBAFormatterTextFieldTypeASCII,  // 数字，字母
} YBAFormatterTextFieldType;

typedef enum : NSUInteger {
    YBAFormatterTextFieldFormatterTypeNone = 0,
    YBAFormatterTextFieldFormatterTypePhone,  // 手机号
    YBAFormatterTextFieldFormatterTypeIDCard,  // 身份证
    YBAFormatterTextFieldFormatterTypeBankCard, // 银行卡
} YBAFormatterTextFieldFormatterType;
@interface YBTextFild : UITextField
/** 必选属性 */
/** 格式类型 */
@property (nonatomic,assign)YBAFormatterTextFieldFormatterType formaterType;

/** 非必选参数 */
/** 最大长度 */
@property (nonatomic,assign)YBAFormatterTextFieldType type;
@property (nonatomic,assign)NSInteger maxLength;


- (NSString *)textWithSpace:(BOOL)space;
@end



@interface UITextField (fx_category)
- (NSRange)selectedRange;
- (void)setSelectedRange:(NSRange) range;
@end

@interface UIImage (fx_catogory)
+ (UIImage *)imageWithColor:(UIColor *)color;
@end

NS_ASSUME_NONNULL_END
